﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Krile.Forms.ConfigForm.Children
{
    public partial class Notification : Krilib.Control.ConfigPage
    {
        public Notification()
        {
            InitializeComponent();
        }

        private void Notification_Load(object sender, EventArgs e)
        {
            ShowBalloonOnStatusReceived.Checked = Core.Config.Notification.ShowBalloonOnStatusReceived;
            BalloonStatusNum.Value = Core.Config.Notification.BalloonStatusNum;
            BalloonStatusQuoteLength.Value = Core.Config.Notification.BalloonStatusQuoteLength;
            FormAutoForeground.Checked = Core.Config.Notification.FormAutoForeground;
            CancelBalloonOnWindowShown.Checked = Core.Config.Notification.CancelBalloonOnWindowShown;
            PlaySound.Checked = Core.Config.Notification.PlaySound;
            NotificationInverval.Value = Core.Config.Notification.NotificationInterval;
            IntervalApplyForAll.Checked = Core.Config.Notification.IntervalApplyForAll;
        }

        public override void Apply()
        {
            Core.Config.Notification.BalloonStatusNum = (int)BalloonStatusNum.Value;
            Core.Config.Notification.BalloonStatusQuoteLength = (int)BalloonStatusQuoteLength.Value;
            Core.Config.Notification.CancelBalloonOnWindowShown = CancelBalloonOnWindowShown.Checked;
            Core.Config.Notification.FormAutoForeground = FormAutoForeground.Checked;
            Core.Config.Notification.PlaySound = PlaySound.Checked;
            Core.Config.Notification.ShowBalloonOnStatusReceived = ShowBalloonOnStatusReceived.Checked;
            Core.Config.Notification.NotificationInterval = (int)NotificationInverval.Value;
            Core.Config.Notification.IntervalApplyForAll = IntervalApplyForAll.Checked;
            base.Apply();
        }
    }
}
